1 module hip.jni.android.configuration;
2 import hip.jni.android.android_api;
3 version(Android):
4 
5 /*
6  * Copyright (C) 2010 The Android Open Source Project
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 /**
22  * @addtogroup Configuration
23  * @{
24  */
25 
26 /**
27  * @file configuration.h
28  */
29 
30 import core.stdc.stdint;
31 import hip.jni.android.asset_manager;
32 
33 extern(C):
34 /**
35  * {@link AConfiguration} is an opaque type used to get and set
36  * various subsystem configurations.
37  *
38  * A {@link AConfiguration} pointer can be obtained using:
39  * - AConfiguration_new()
40  * - AConfiguration_fromAssetManager()
41  */
42 struct AConfiguration;
43 
44 
45 /**
46  * Define flags and constants for various subsystem configurations.
47  */
48 enum {
49     /** Orientation: not specified. */
50     ACONFIGURATION_ORIENTATION_ANY  = 0x0000,
51     /**
52      * Orientation: value corresponding to the
53      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#OrientationQualifier">port</a>
54      * resource qualifier.
55      */
56     ACONFIGURATION_ORIENTATION_PORT = 0x0001,
57     /**
58      * Orientation: value corresponding to the
59      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#OrientationQualifier">land</a>
60      * resource qualifier.
61      */
62     ACONFIGURATION_ORIENTATION_LAND = 0x0002,
63     /** @deprecated Not currently supported or used. */
64     ACONFIGURATION_ORIENTATION_SQUARE = 0x0003,
65 
66     /** Touchscreen: not specified. */
67     ACONFIGURATION_TOUCHSCREEN_ANY  = 0x0000,
68     /**
69      * Touchscreen: value corresponding to the
70      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#TouchscreenQualifier">notouch</a>
71      * resource qualifier.
72      */
73     ACONFIGURATION_TOUCHSCREEN_NOTOUCH  = 0x0001,
74     /** @deprecated Not currently supported or used. */
75     ACONFIGURATION_TOUCHSCREEN_STYLUS  = 0x0002,
76     /**
77      * Touchscreen: value corresponding to the
78      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#TouchscreenQualifier">finger</a>
79      * resource qualifier.
80      */
81     ACONFIGURATION_TOUCHSCREEN_FINGER  = 0x0003,
82 
83     /** Density: default density. */
84     ACONFIGURATION_DENSITY_DEFAULT = 0,
85     /**
86      * Density: value corresponding to the
87      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">ldpi</a>
88      * resource qualifier.
89      */
90     ACONFIGURATION_DENSITY_LOW = 120,
91     /**
92      * Density: value corresponding to the
93      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">mdpi</a>
94      * resource qualifier.
95      */
96     ACONFIGURATION_DENSITY_MEDIUM = 160,
97     /**
98      * Density: value corresponding to the
99      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">tvdpi</a>
100      * resource qualifier.
101      */
102     ACONFIGURATION_DENSITY_TV = 213,
103     /**
104      * Density: value corresponding to the
105      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">hdpi</a>
106      * resource qualifier.
107      */
108     ACONFIGURATION_DENSITY_HIGH = 240,
109     /**
110      * Density: value corresponding to the
111      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">xhdpi</a>
112      * resource qualifier.
113      */
114     ACONFIGURATION_DENSITY_XHIGH = 320,
115     /**
116      * Density: value corresponding to the
117      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">xxhdpi</a>
118      * resource qualifier.
119      */
120     ACONFIGURATION_DENSITY_XXHIGH = 480,
121     /**
122      * Density: value corresponding to the
123      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">xxxhdpi</a>
124      * resource qualifier.
125      */
126     ACONFIGURATION_DENSITY_XXXHIGH = 640,
127     /** Density: any density. */
128     ACONFIGURATION_DENSITY_ANY = 0xfffe,
129     /** Density: no density specified. */
130     ACONFIGURATION_DENSITY_NONE = 0xffff,
131 
132     /** Keyboard: not specified. */
133     ACONFIGURATION_KEYBOARD_ANY  = 0x0000,
134     /**
135      * Keyboard: value corresponding to the
136      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">nokeys</a>
137      * resource qualifier.
138      */
139     ACONFIGURATION_KEYBOARD_NOKEYS  = 0x0001,
140     /**
141      * Keyboard: value corresponding to the
142      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">qwerty</a>
143      * resource qualifier.
144      */
145     ACONFIGURATION_KEYBOARD_QWERTY  = 0x0002,
146     /**
147      * Keyboard: value corresponding to the
148      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">12key</a>
149      * resource qualifier.
150      */
151     ACONFIGURATION_KEYBOARD_12KEY  = 0x0003,
152 
153     /** Navigation: not specified. */
154     ACONFIGURATION_NAVIGATION_ANY  = 0x0000,
155     /**
156      * Navigation: value corresponding to the
157      * <a href="@@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">nonav</a>
158      * resource qualifier.
159      */
160     ACONFIGURATION_NAVIGATION_NONAV  = 0x0001,
161     /**
162      * Navigation: value corresponding to the
163      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">dpad</a>
164      * resource qualifier.
165      */
166     ACONFIGURATION_NAVIGATION_DPAD  = 0x0002,
167     /**
168      * Navigation: value corresponding to the
169      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">trackball</a>
170      * resource qualifier.
171      */
172     ACONFIGURATION_NAVIGATION_TRACKBALL  = 0x0003,
173     /**
174      * Navigation: value corresponding to the
175      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">wheel</a>
176      * resource qualifier.
177      */
178     ACONFIGURATION_NAVIGATION_WHEEL  = 0x0004,
179 
180     /** Keyboard availability: not specified. */
181     ACONFIGURATION_KEYSHIDDEN_ANY = 0x0000,
182     /**
183      * Keyboard availability: value corresponding to the
184      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keysexposed</a>
185      * resource qualifier.
186      */
187     ACONFIGURATION_KEYSHIDDEN_NO = 0x0001,
188     /**
189      * Keyboard availability: value corresponding to the
190      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keyshidden</a>
191      * resource qualifier.
192      */
193     ACONFIGURATION_KEYSHIDDEN_YES = 0x0002,
194     /**
195      * Keyboard availability: value corresponding to the
196      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keyssoft</a>
197      * resource qualifier.
198      */
199     ACONFIGURATION_KEYSHIDDEN_SOFT = 0x0003,
200 
201     /** Navigation availability: not specified. */
202     ACONFIGURATION_NAVHIDDEN_ANY = 0x0000,
203     /**
204      * Navigation availability: value corresponding to the
205      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavAvailQualifier">navexposed</a>
206      * resource qualifier.
207      */
208     ACONFIGURATION_NAVHIDDEN_NO = 0x0001,
209     /**
210      * Navigation availability: value corresponding to the
211      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavAvailQualifier">navhidden</a>
212      * resource qualifier.
213      */
214     ACONFIGURATION_NAVHIDDEN_YES = 0x0002,
215 
216     /** Screen size: not specified. */
217     ACONFIGURATION_SCREENSIZE_ANY  = 0x00,
218     /**
219      * Screen size: value indicating the screen is at least
220      * approximately 320x426 dp units, corresponding to the
221      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">small</a>
222      * resource qualifier.
223      */
224     ACONFIGURATION_SCREENSIZE_SMALL = 0x01,
225     /**
226      * Screen size: value indicating the screen is at least
227      * approximately 320x470 dp units, corresponding to the
228      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">normal</a>
229      * resource qualifier.
230      */
231     ACONFIGURATION_SCREENSIZE_NORMAL = 0x02,
232     /**
233      * Screen size: value indicating the screen is at least
234      * approximately 480x640 dp units, corresponding to the
235      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">large</a>
236      * resource qualifier.
237      */
238     ACONFIGURATION_SCREENSIZE_LARGE = 0x03,
239     /**
240      * Screen size: value indicating the screen is at least
241      * approximately 720x960 dp units, corresponding to the
242      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">xlarge</a>
243      * resource qualifier.
244      */
245     ACONFIGURATION_SCREENSIZE_XLARGE = 0x04,
246 
247     /** Screen layout: not specified. */
248     ACONFIGURATION_SCREENLONG_ANY = 0x00,
249     /**
250      * Screen layout: value that corresponds to the
251      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenAspectQualifier">notlong</a>
252      * resource qualifier.
253      */
254     ACONFIGURATION_SCREENLONG_NO = 0x1,
255     /**
256      * Screen layout: value that corresponds to the
257      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenAspectQualifier">long</a>
258      * resource qualifier.
259      */
260     ACONFIGURATION_SCREENLONG_YES = 0x2,
261 
262     ACONFIGURATION_SCREENROUND_ANY = 0x00,
263     ACONFIGURATION_SCREENROUND_NO = 0x1,
264     ACONFIGURATION_SCREENROUND_YES = 0x2,
265 
266     /** Wide color gamut: not specified. */
267     ACONFIGURATION_WIDE_COLOR_GAMUT_ANY = 0x00,
268     /**
269      * Wide color gamut: value that corresponds to
270      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#WideColorGamutQualifier">no
271      * nowidecg</a> resource qualifier specified.
272      */
273     ACONFIGURATION_WIDE_COLOR_GAMUT_NO = 0x1,
274     /**
275      * Wide color gamut: value that corresponds to
276      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#WideColorGamutQualifier">
277      * widecg</a> resource qualifier specified.
278      */
279     ACONFIGURATION_WIDE_COLOR_GAMUT_YES = 0x2,
280 
281     /** HDR: not specified. */
282     ACONFIGURATION_HDR_ANY = 0x00,
283     /**
284      * HDR: value that corresponds to
285      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#HDRQualifier">
286      * lowdr</a> resource qualifier specified.
287      */
288     ACONFIGURATION_HDR_NO = 0x1,
289     /**
290      * HDR: value that corresponds to
291      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#HDRQualifier">
292      * highdr</a> resource qualifier specified.
293      */
294     ACONFIGURATION_HDR_YES = 0x2,
295 
296     /** UI mode: not specified. */
297     ACONFIGURATION_UI_MODE_TYPE_ANY = 0x00,
298     /**
299      * UI mode: value that corresponds to
300      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">no
301      * UI mode type</a> resource qualifier specified.
302      */
303     ACONFIGURATION_UI_MODE_TYPE_NORMAL = 0x01,
304     /**
305      * UI mode: value that corresponds to
306      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">desk</a> resource qualifier specified.
307      */
308     ACONFIGURATION_UI_MODE_TYPE_DESK = 0x02,
309     /**
310      * UI mode: value that corresponds to
311      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">car</a> resource qualifier specified.
312      */
313     ACONFIGURATION_UI_MODE_TYPE_CAR = 0x03,
314     /**
315      * UI mode: value that corresponds to
316      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">television</a> resource qualifier specified.
317      */
318     ACONFIGURATION_UI_MODE_TYPE_TELEVISION = 0x04,
319     /**
320      * UI mode: value that corresponds to
321      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">appliance</a> resource qualifier specified.
322      */
323     ACONFIGURATION_UI_MODE_TYPE_APPLIANCE = 0x05,
324     /**
325      * UI mode: value that corresponds to
326      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">watch</a> resource qualifier specified.
327      */
328     ACONFIGURATION_UI_MODE_TYPE_WATCH = 0x06,
329     /**
330      * UI mode: value that corresponds to
331      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">vr</a> resource qualifier specified.
332      */
333     ACONFIGURATION_UI_MODE_TYPE_VR_HEADSET = 0x07,
334 
335     /** UI night mode: not specified.*/
336     ACONFIGURATION_UI_MODE_NIGHT_ANY = 0x00,
337     /**
338      * UI night mode: value that corresponds to
339      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NightQualifier">notnight</a> resource qualifier specified.
340      */
341     ACONFIGURATION_UI_MODE_NIGHT_NO = 0x1,
342     /**
343      * UI night mode: value that corresponds to
344      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NightQualifier">night</a> resource qualifier specified.
345      */
346     ACONFIGURATION_UI_MODE_NIGHT_YES = 0x2,
347 
348     /** Screen width DPI: not specified. */
349     ACONFIGURATION_SCREEN_WIDTH_DP_ANY = 0x0000,
350 
351     /** Screen height DPI: not specified. */
352     ACONFIGURATION_SCREEN_HEIGHT_DP_ANY = 0x0000,
353 
354     /** Smallest screen width DPI: not specified.*/
355     ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY = 0x0000,
356 
357     /** Layout direction: not specified. */
358     ACONFIGURATION_LAYOUTDIR_ANY  = 0x00,
359     /**
360      * Layout direction: value that corresponds to
361      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">ldltr</a> resource qualifier specified.
362      */
363     ACONFIGURATION_LAYOUTDIR_LTR  = 0x01,
364     /**
365      * Layout direction: value that corresponds to
366      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">ldrtl</a> resource qualifier specified.
367      */
368     ACONFIGURATION_LAYOUTDIR_RTL  = 0x02,
369 
370     /**
371      * Bit mask for
372      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#MccQualifier">mcc</a>
373      * configuration.
374      */
375     ACONFIGURATION_MCC = 0x0001,
376     /**
377      * Bit mask for
378      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#MccQualifier">mnc</a>
379      * configuration.
380      */
381     ACONFIGURATION_MNC = 0x0002,
382     /**
383      * Bit mask for
384      * <a href="{@docRoot}guide/topics/resources/providing-resources.html#LocaleQualifier">locale</a>
385      * configuration.
386      */
387     ACONFIGURATION_LOCALE = 0x0004,
388     /**
389      * Bit mask for
390      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#TouchscreenQualifier">touchscreen</a>
391      * configuration.
392      */
393     ACONFIGURATION_TOUCHSCREEN = 0x0008,
394     /**
395      * Bit mask for
396      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">keyboard</a>
397      * configuration.
398      */
399     ACONFIGURATION_KEYBOARD = 0x0010,
400     /**
401      * Bit mask for
402      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keyboardHidden</a>
403      * configuration.
404      */
405     ACONFIGURATION_KEYBOARD_HIDDEN = 0x0020,
406     /**
407      * Bit mask for
408      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">navigation</a>
409      * configuration.
410      */
411     ACONFIGURATION_NAVIGATION = 0x0040,
412     /**
413      * Bit mask for
414      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#OrientationQualifier">orientation</a>
415      * configuration.
416      */
417     ACONFIGURATION_ORIENTATION = 0x0080,
418     /**
419      * Bit mask for
420      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">density</a>
421      * configuration.
422      */
423     ACONFIGURATION_DENSITY = 0x0100,
424     /**
425      * Bit mask for
426      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">screen size</a>
427      * configuration.
428      */
429     ACONFIGURATION_SCREEN_SIZE = 0x0200,
430     /**
431      * Bit mask for
432      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#VersionQualifier">platform version</a>
433      * configuration.
434      */
435     ACONFIGURATION_VERSION = 0x0400,
436     /**
437      * Bit mask for screen layout configuration.
438      */
439     ACONFIGURATION_SCREEN_LAYOUT = 0x0800,
440     /**
441      * Bit mask for
442      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">ui mode</a>
443      * configuration.
444      */
445     ACONFIGURATION_UI_MODE = 0x1000,
446     /**
447      * Bit mask for
448      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#SmallestScreenWidthQualifier">smallest screen width</a>
449      * configuration.
450      */
451     ACONFIGURATION_SMALLEST_SCREEN_SIZE = 0x2000,
452     /**
453      * Bit mask for
454      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">layout direction</a>
455      * configuration.
456      */
457     ACONFIGURATION_LAYOUTDIR = 0x4000,
458     ACONFIGURATION_SCREEN_ROUND = 0x8000,
459     /**
460      * Bit mask for
461      * <a href="@dacRoot/guide/topics/resources/providing-resources.html#WideColorGamutQualifier">wide color gamut</a>
462      * and <a href="@dacRoot/guide/topics/resources/providing-resources.html#HDRQualifier">HDR</a> configurations.
463      */
464     ACONFIGURATION_COLOR_MODE = 0x10000,
465     /**
466      * Constant used to to represent MNC (Mobile Network Code) zero.
467      * 0 cannot be used, since it is used to represent an undefined MNC.
468      */
469     ACONFIGURATION_MNC_ZERO = 0xffff,
470 }
471 
472 /**
473  * Create a new AConfiguration, initialized with no values set.
474  */
475 AConfiguration* AConfiguration_new();
476 
477 /**
478  * Free an AConfiguration that was previously created with
479  * AConfiguration_new().
480  */
481 void AConfiguration_delete(AConfiguration* config);
482 
483 /**
484  * Create and return a new AConfiguration based on the current configuration in
485  * use in the given {@link AAssetManager}.
486  */
487 void AConfiguration_fromAssetManager(AConfiguration* out_, AAssetManager* am);
488 
489 /**
490  * Copy the contents of 'src' to 'dest'.
491  */
492 void AConfiguration_copy(AConfiguration* dest, AConfiguration* src);
493 
494 /**
495  * Return the current MCC set in the configuration.  0 if not set.
496  */
497 int32_t AConfiguration_getMcc(AConfiguration* config);
498 
499 /**
500  * Set the current MCC in the configuration.  0 to clear.
501  */
502 void AConfiguration_setMcc(AConfiguration* config, int32_t mcc);
503 
504 /**
505  * Return the current MNC set in the configuration.  0 if not set.
506  */
507 int32_t AConfiguration_getMnc(AConfiguration* config);
508 
509 /**
510  * Set the current MNC in the configuration.  0 to clear.
511  */
512 void AConfiguration_setMnc(AConfiguration* config, int32_t mnc);
513 
514 /**
515  * Return the current language code set in the configuration.  The output will
516  * be filled with an array of two characters.  They are not 0-terminated.  If
517  * a language is not set, they will be 0.
518  */
519 void AConfiguration_getLanguage(AConfiguration* config, char* outLanguage);
520 
521 /**
522  * Set the current language code in the configuration, from the first two
523  * characters in the string.
524  */
525 void AConfiguration_setLanguage(AConfiguration* config, const char* language);
526 
527 /**
528  * Return the current country code set in the configuration.  The output will
529  * be filled with an array of two characters.  They are not 0-terminated.  If
530  * a country is not set, they will be 0.
531  */
532 void AConfiguration_getCountry(AConfiguration* config, char* outCountry);
533 
534 /**
535  * Set the current country code in the configuration, from the first two
536  * characters in the string.
537  */
538 void AConfiguration_setCountry(AConfiguration* config, const char* country);
539 
540 /**
541  * Return the current ACONFIGURATION_ORIENTATION_* set in the configuration.
542  */
543 int32_t AConfiguration_getOrientation(AConfiguration* config);
544 
545 /**
546  * Set the current orientation in the configuration.
547  */
548 void AConfiguration_setOrientation(AConfiguration* config, int32_t orientation);
549 
550 /**
551  * Return the current ACONFIGURATION_TOUCHSCREEN_* set in the configuration.
552  */
553 int32_t AConfiguration_getTouchscreen(AConfiguration* config);
554 
555 /**
556  * Set the current touchscreen in the configuration.
557  */
558 void AConfiguration_setTouchscreen(AConfiguration* config, int32_t touchscreen);
559 
560 /**
561  * Return the current ACONFIGURATION_DENSITY_* set in the configuration.
562  */
563 int32_t AConfiguration_getDensity(AConfiguration* config);
564 
565 /**
566  * Set the current density in the configuration.
567  */
568 void AConfiguration_setDensity(AConfiguration* config, int32_t density);
569 
570 /**
571  * Return the current ACONFIGURATION_KEYBOARD_* set in the configuration.
572  */
573 int32_t AConfiguration_getKeyboard(AConfiguration* config);
574 
575 /**
576  * Set the current keyboard in the configuration.
577  */
578 void AConfiguration_setKeyboard(AConfiguration* config, int32_t keyboard);
579 
580 /**
581  * Return the current ACONFIGURATION_NAVIGATION_* set in the configuration.
582  */
583 int32_t AConfiguration_getNavigation(AConfiguration* config);
584 
585 /**
586  * Set the current navigation in the configuration.
587  */
588 void AConfiguration_setNavigation(AConfiguration* config, int32_t navigation);
589 
590 /**
591  * Return the current ACONFIGURATION_KEYSHIDDEN_* set in the configuration.
592  */
593 int32_t AConfiguration_getKeysHidden(AConfiguration* config);
594 
595 /**
596  * Set the current keys hidden in the configuration.
597  */
598 void AConfiguration_setKeysHidden(AConfiguration* config, int32_t keysHidden);
599 
600 /**
601  * Return the current ACONFIGURATION_NAVHIDDEN_* set in the configuration.
602  */
603 int32_t AConfiguration_getNavHidden(AConfiguration* config);
604 
605 /**
606  * Set the current nav hidden in the configuration.
607  */
608 void AConfiguration_setNavHidden(AConfiguration* config, int32_t navHidden);
609 
610 /**
611  * Return the current SDK (API) version set in the configuration.
612  */
613 int32_t AConfiguration_getSdkVersion(AConfiguration* config);
614 
615 /**
616  * Set the current SDK version in the configuration.
617  */
618 void AConfiguration_setSdkVersion(AConfiguration* config, int32_t sdkVersion);
619 
620 /**
621  * Return the current ACONFIGURATION_SCREENSIZE_* set in the configuration.
622  */
623 int32_t AConfiguration_getScreenSize(AConfiguration* config);
624 
625 /**
626  * Set the current screen size in the configuration.
627  */
628 void AConfiguration_setScreenSize(AConfiguration* config, int32_t screenSize);
629 
630 /**
631  * Return the current ACONFIGURATION_SCREENLONG_* set in the configuration.
632  */
633 int32_t AConfiguration_getScreenLong(AConfiguration* config);
634 
635 /**
636  * Set the current screen long in the configuration.
637  */
638 void AConfiguration_setScreenLong(AConfiguration* config, int32_t screenLong);
639 
640 static if(__ANDROID_API__ >= 30)
641 {
642     /**
643     * Return the current ACONFIGURATION_SCREENROUND_* set in the configuration.
644     *
645     * Available since API level 30.
646     */
647     int32_t AConfiguration_getScreenRound(AConfiguration* config);
648 }
649 
650 /**
651  * Set the current screen round in the configuration.
652  */
653 void AConfiguration_setScreenRound(AConfiguration* config, int32_t screenRound);
654 
655 /**
656  * Return the current ACONFIGURATION_UI_MODE_TYPE_* set in the configuration.
657  */
658 int32_t AConfiguration_getUiModeType(AConfiguration* config);
659 
660 /**
661  * Set the current UI mode type in the configuration.
662  */
663 void AConfiguration_setUiModeType(AConfiguration* config, int32_t uiModeType);
664 
665 /**
666  * Return the current ACONFIGURATION_UI_MODE_NIGHT_* set in the configuration.
667  */
668 int32_t AConfiguration_getUiModeNight(AConfiguration* config);
669 
670 /**
671  * Set the current UI mode night in the configuration.
672  */
673 void AConfiguration_setUiModeNight(AConfiguration* config, int32_t uiModeNight);
674 
675 /**
676  * Return the current configuration screen width in dp units, or
677  * ACONFIGURATION_SCREEN_WIDTH_DP_ANY if not set.
678  */
679 int32_t AConfiguration_getScreenWidthDp(AConfiguration* config);
680 
681 /**
682  * Set the configuration's current screen width in dp units.
683  */
684 void AConfiguration_setScreenWidthDp(AConfiguration* config, int32_t value);
685 
686 /**
687  * Return the current configuration screen height in dp units, or
688  * ACONFIGURATION_SCREEN_HEIGHT_DP_ANY if not set.
689  */
690 int32_t AConfiguration_getScreenHeightDp(AConfiguration* config);
691 
692 /**
693  * Set the configuration's current screen width in dp units.
694  */
695 void AConfiguration_setScreenHeightDp(AConfiguration* config, int32_t value);
696 
697 /**
698  * Return the configuration's smallest screen width in dp units, or
699  * ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY if not set.
700  */
701 int32_t AConfiguration_getSmallestScreenWidthDp(AConfiguration* config);
702 
703 /**
704  * Set the configuration's smallest screen width in dp units.
705  */
706 void AConfiguration_setSmallestScreenWidthDp(AConfiguration* config, int32_t value);
707 
708 static if(__ANDROID_API__ >= 17)
709 {
710     /**
711     * Return the configuration's layout direction, or
712     * ACONFIGURATION_LAYOUTDIR_ANY if not set.
713     *
714     * Available since API level 17.
715     */
716     int32_t AConfiguration_getLayoutDirection(AConfiguration* config);
717 
718     /**
719     * Set the configuration's layout direction.
720     *
721     * Available since API level 17.
722     */
723     void AConfiguration_setLayoutDirection(AConfiguration* config, int32_t value);
724 }
725 
726 /**
727  * Perform a diff between two configurations.  Returns a bit mask of
728  * ACONFIGURATION_* constants, each bit set meaning that configuration element
729  * is different between them.
730  */
731 int32_t AConfiguration_diff(AConfiguration* config1, AConfiguration* config2);
732 
733 /**
734  * Determine whether 'base' is a valid configuration for use within the
735  * environment 'requested'.  Returns 0 if there are any values in 'base'
736  * that conflict with 'requested'.  Returns 1 if it does not conflict.
737  */
738 int32_t AConfiguration_match(AConfiguration* base, AConfiguration* requested);
739 
740 /**
741  * Determine whether the configuration in 'test' is better than the existing
742  * configuration in 'base'.  If 'requested' is non-NULL, this decision is based
743  * on the overall configuration given there.  If it is NULL, this decision is
744  * simply based on which configuration is more specific.  Returns non-0 if
745  * 'test' is better than 'base'.
746  *
747  * This assumes you have already filtered the configurations with
748  * AConfiguration_match().
749  */
750 int32_t AConfiguration_isBetterThan(AConfiguration* base, AConfiguration* test,
751         AConfiguration* requested);